package com.wjs.zpro.dao.impl;

import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import com.wjs.zpro.dao.UserDao;
import com.wjs.zpro.entity.UserEntity;

import java.sql.SQLException;

public class UserDaoImpl implements UserDao {

    public void save(UserEntity user) throws SQLException {
        Entity set = Entity.create("user")
                            .set("username", user.getUsername())
                            .set("password", user.getPassword())
                            .set("email", user.getEmail());
        Db.use().insert(set);
        System.out.println("保存用户成功"+ user);

    }
}
